#!/bin/sh

set -e

dir=k8s-kernel-4.19.12

mkdir -p $dir
cd $dir
wget http://193.49.22.109/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-4.19.12-1.el7.elrepo.x86_64.rpm
wget http://193.49.22.109/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-4.19.12-1.el7.elrepo.x86_64.rpm

yum localinstall kernel-ml-* -y

grub2-set-default  0 && grub2-mkconfig -o /etc/grub2.cfg
grubby --args="user_namespace.enable=1" --update-kernel="$(grubby --default-kernel)"

# 检查默认内核是不是安装后的版本 /boot/vmlinuz-4.19.12-1.el7.elrepo.x86_64
grubby --default-kernel 

cd ..
sh zlast.sh
